﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AuroraWuBi
{
    //词频
   public class Frequency
    {

        private Dictionary<string, int> _FreqDit;//所有字、词的频率，数字大的频率高
        public Dictionary<string, int> FreqDit
        {
            get
            {
                return _FreqDit;
            }
        }
        public void AddFre(string _words, int _freq)
        {
            if (_FreqDit == null)
            {
                _FreqDit = new Dictionary<string, int>();
                _FreqDit.Add(_words, _freq);
            }
            else
            {
                if (_FreqDit.ContainsKey(_words))
                {
                  //  Console.WriteLine("警告：存在重复的字词频率，字词为：{0}", _words);
                }
                else
                {
                    _FreqDit.Add(_words,  _freq );
                }
            }

        }

       

    
    
    }
}
